/**********************************************************************
 * SailmiPIM - modular cross-platform feature Personal Information Manager Tools.
 * Copyright(C) 2010-2012  Oleg Linkin
 * Copyright(C) 2006-2014  Georg Rudoy
 *
 * Distributed under the Boost Software License, Version 1.0.
 *(See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
 **********************************************************************/

#pragma once

#include <QObject>
#include <QMenu>
#include <sailmipim/iinfo.h>
#include <sailmipim/core/icoretabwidget.h>
#include <sailmipim/iplugin2.h>
#include <sailmipim/core/ihookproxy.h>

class QMainWindow;

namespace SailmiPIM::Plugin::UserProxy
{
	class Plugin : public QObject
				, public IInfo
				, public IPlugin2
	{
		Q_OBJECT
		Q_INTERFACES(IInfo IPlugin2)

        SAILMIPIM_PLUGIN_METADATA("com.sailm.pim.plugin.UserProxy")

		ICoreTabWidget *MainTabWidget_;

		ICoreProxy_ptr Proxy_;

		QHash<QMainWindow*, QHash<QWidget*, QPair<QString, QWidget*>>> Window2Widget2TabData_;
		QTabBar::ButtonPosition CloseSide_;
	public:
		void Init(ICoreProxy_ptr proxy) override;
		void SecondInit() override;
		QByteArray GetUniqueID() const override;
		void Release() override;
		QString GetName() const override;
		QString GetInfo() const override;
		QIcon GetIcon() const override;
        bool IsCore() const override;
		QSet<QByteArray> GetPluginClasses() const override;

	};
}
